# -*- coding: utf-8 -*-
# @File     : services.py
# @Author   : bingjia
# @Time     : 2020/8/5 21:20
# @Desc     :

from . import models


def get_train_model_path():
    pass


def is_network_already_exist(name):
    """
    网络是否存在
    """
    network_model = models.NetworkModel
    if network_model.objects.filter(name=name,):
        return (True, _("network is already exist"))

    return (False, None)


def is_model_already_exist(name):
    """
    模型是否存在
    """
    model_model = models.ModelInfo
    if model_model.objects.filter(name=name,):
        return (True, _("model is already exist"))

    return (False, None)